package cn.qiguai.sphapi.controller.response;

import lombok.*;

import java.util.List;

@Getter
@Setter
public class Page<T> {
	private int totalCount;		//总数
	private int currentPage;	//当前页数
	private int pageSize;		//每页数量
	private boolean hasNext;	//是否存在下一页
	private List<T> data;		//数据

	public void computeHasNext() {
		//计算总页数
		int totalPages = (int) Math.ceil((double) totalCount / pageSize);

		hasNext = currentPage < totalPages;
	}
}
